﻿<%@ Page language="C#"     %> 

<%@ Assembly Name="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Import Namespace="Microsoft.SharePoint" %> 

<%@ Assembly Name="Evolution, Version=1.0.0.0, Culture=neutral, PublicKeyToken=78dcb006c8576059" %>
<%@ Import Namespace="Evolution.Expression" %>
<%@ Import Namespace="Evolution.UI.WebParts" %>
<%@ Import Namespace="Evolution.Utilities" %>

<html>
<head>
    <title>Preview</title>    
    
    <script runat="server">
        public void Page_Load(object sender, EventArgs e)
        {
            ExpressionInterpreter interpreter = new ExpressionInterpreter(SPContext.Current.Web);

            string url = Request.QueryString["Source"];
            if (!StringUtility.IsNullOrEmpty(url))
            {
                url = interpreter.ParseExpression(url);
                this.Response.Redirect(url);
            }
            else
                this.Literal1.Text = @"<script type=""text/javascript"">self.close();</" + "script>";
        }
    </script>
</head>
<body>
    <asp:Literal runat="server" ID="Literal1"></asp:Literal>
</body>
</html>
